<?php

class PrizeForm extends CFormModel
{
	public $name;
	public $description;
	public $value;
	public $upload;

	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		return array(
			array('name, description, value', 'required'),
			array('upload', 'required', 'on'=>'create'),
			array('upload', 'file', 'types'=>'jpg, gif, png'),
		);
	}

	/**
	 * Decalres the attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'name' => Yii::t('label','Name'),
			'description' => Yii::t('label','Description'),
			'value' => Yii::t('label','Value (€)'),
			'upload' => Yii::t('label','Image'),
		);
	}
}
